package com.tjn.enum_;

public class EnumDetail {
    public static void main(String[] args) {

    }
}

class Eating{

}
//枚举类不能继承其他类，因为枚举类底层本来就继承了Enum类，枚举类不能继承其他类
//enum Food extends Eating{
//    APPLE("苹果"), BANANA("香蕉"), ORANGE("橘子");
//    private String name;
//    Food(String name){
//        this.name = name;
//    }
//}

interface Eatable{
    void eat();
}
//枚举类能实现接口
class Food2 implements Eatable{
    private String name;
    Food2(String name){
        this.name = name;
    }
    public void eat(){
        System.out.println("吃" + name);
    }
}